home *** CD-ROM | disk | FTP | other *** search
/ Steal This CD / steal_this_cd.iso / Chapter 20 - Adware and Spyware / enough.exe / inst-but.bat < prev    next >
DOS Batch File  |  2002-04-14  |  11KB  |  465 lines

  1. @echo off
  2.  
  3. cls 
  4.  
  5. :: Installer for IE Power Tweaks WebZone Accessory and Toolbar Buttons
  6. ::
  7. :: Created by Eric L. Howes
  8. ::            eburger68@myrealbox.com
  9. ::            http://www.staff.uiuc.edu/~ehowes/
  10. ::
  11. :: Copyright (c) 2000-2002 Eric L. Howes
  12. ::
  13. :: This program is free software; you can redistribute it and/or modify it under
  14. :: the terms of the GNU General Public License as published by the Free Software
  15. :: Foundation; either version 2, or (at your option) any later version.
  16. ::
  17. :: This program is distributed in the hope that it will be useful, but WITHOUT ANY
  18. :: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  19. :: A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  20. ::
  21. :: Some files distributed with this package may not be covered by the GNU GPL. Those
  22. :: files remain the property of their original owners and are covered by the licenses
  23. :: under which they were originally distributed.
  24. ::
  25. :: All trademarks are the property of their respective owners.
  26. ::
  27. :: You should have received a copy of the GNU General Public License along with this
  28. :: program; see the file COPYING.  If not, write to the Free Software Foundation,
  29. :: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  30.  
  31. :: Check for NT or 9x
  32. if exist %WINDIR%\SYSTEM32\CONFIG goto prep-nt
  33.  
  34. :: ---------------
  35. :: Copy choice.com
  36. :: ---------------
  37. :prep-9x
  38.  
  39. if exist %WINDIR%\command\choice.com goto MENU
  40. if exist %WINDIR%\choice.com goto MENU
  41.  
  42. copy choice\choice.com %WINDIR%
  43.  
  44. goto MENU
  45.  
  46. :: ---------------
  47. :: Copy choice.exe
  48. :: ---------------
  49. :prep-nt
  50.  
  51. if exist %WINDIR%\command\choice.exe goto MENU
  52. if exist %WINDIR%\choice.exe goto MENU
  53.  
  54. copy choice\choice.exe %WINDIR%
  55.  
  56. goto MENU
  57.  
  58. ::********************************************************************
  59. :MENU
  60. ::********************************************************************
  61.  
  62. cls
  63.  
  64. :: -------------------------------
  65. :: Give the main menu with choices
  66. :: -------------------------------
  67.  
  68. echo     ---------------------------------
  69. echo              Installer for 
  70. echo.
  71. echo     IE Power Tweaks WebZone Accessory 
  72. echo.
  73. echo           and Toolbar Buttons
  74. echo     ---------------------------------
  75. echo.
  76. echo             ** Main Menu **
  77. echo.
  78. echo.
  79. echo    [1] INSTALL (complete or just buttons)
  80. echo.
  81. echo    [2] REMOVE  (complete or just buttons)
  82. echo.
  83. echo    [3] Exit
  84. echo.
  85.  
  86. :: ----------
  87. :: Get choice
  88. :: ----------
  89.  
  90. echo    What do you want to do?
  91.  
  92. choice /c:1234 /n /t:4,90 
  93.  
  94. if errorlevel 4 goto MENU
  95. if errorlevel 3 goto FIN
  96. if errorlevel 2 goto UNINST
  97. if errorlevel 1 goto INSTALL
  98.  
  99. goto MENU
  100.  
  101. ::********************************************************************
  102. :INSTALL
  103. ::********************************************************************
  104.  
  105. cls
  106.  
  107. :: ---------------
  108. :: Confirm Install
  109. :: ---------------
  110.  
  111.    echo.
  112.    echo                      ** INSTALL MENU **
  113.    echo. 
  114.    echo.
  115.    echo    What would you like to install? 
  116.    echo. 
  117.    echo       [1] IE Power Tweaks WebZone Accessory and Buttons
  118.    echo       [2] Buttons only (Power Tweaks is already installed)
  119.    echo       [3] Nothing - return to main menu
  120.  
  121.    choice /c:1234 /n /t:4,90
  122.  
  123.    if errorlevel 4 goto INSTALL
  124.    if errorlevel 3 goto MENU
  125.    if errorlevel 2 goto GO-BUTT
  126.    if errorlevel 1 goto GO-COMP
  127.  
  128. goto INSTALL
  129.  
  130. ::------
  131. :GO-COMP
  132. ::------
  133.  
  134.    :: check for previous install of WebZone
  135.  
  136.    if exist %WINDIR%\SYSTEM\webzone.dll goto PROC-BUTT
  137.    if exist %WINDIR%\SYSTEM32\webzone.dll goto PROC-BUTT
  138.  
  139.    :: install WebZone and buttons
  140.  
  141.    start /w RunDll32 advpack.dll,LaunchINFSection webzone\webzone.inf, DefaultInstall
  142.  
  143.    :: confirm installation
  144.  
  145.    if exist %WINDIR%\SYSTEM\webzone.dll goto SUCCESS
  146.    if exist %WINDIR%\SYSTEM32\webzone.dll goto SUCCESS
  147.  
  148.    goto ERROR
  149.  
  150. ::------
  151. :GO-BUTT
  152. ::------
  153.  
  154.    :: check for previous install of WebZone
  155.  
  156.    if exist %WINDIR%\SYSTEM\webzone.dll goto PROC-BUTT
  157.    if exist %WINDIR%\SYSTEM32\webzone.dll goto PROC-BUTT
  158.  
  159.    goto NO-WA
  160.  
  161.    :PROC-BUTT
  162.  
  163.    if exist %WINDIR%\SYSTEM32\config goto BUTT-NT
  164.  
  165.    :: install Buttons on 9x-Me
  166.  
  167.    copy webzone\TSGRAY.ICO %WINDIR%\SYSTEM
  168.    copy webzone\RSGRAY.ICO %WINDIR%\SYSTEM
  169.    copy webzone\TSCOLOR.ICO %WINDIR%\SYSTEM
  170.    copy webzone\RSCOLOR.ICO %WINDIR%\SYSTEM
  171.  
  172.    start /w regedit.exe /s webzone\zb-9x.reg
  173.  
  174.    goto SUCC-2
  175.  
  176.    :BUTT-NT
  177.  
  178.    :: install Buttons on NT-2K-XP
  179.  
  180.    copy webzone\TSGRAY.ICO %WINDIR%\SYSTEM32
  181.    copy webzone\RSGRAY.ICO %WINDIR%\SYSTEM32
  182.    copy webzone\TSCOLOR.ICO %WINDIR%\SYSTEM32
  183.    copy webzone\RSCOLOR.ICO %WINDIR%\SYSTEM32
  184.  
  185.    start /w regedit.exe /s webzone\zb-nt.reg
  186.  
  187.    goto SUCC-2
  188.  
  189.  
  190. ::********************************************************************
  191. :UNINST
  192. ::********************************************************************
  193.  
  194. cls
  195.  
  196. :: -----------------
  197. :: Confirm Uninstall
  198. :: -----------------
  199.  
  200.    echo.
  201.    echo                      ** UNINSTALL MENU **
  202.    echo. 
  203.    echo.
  204.    echo    What would you like to uninstall? 
  205.    echo. 
  206.    echo       [1] IE Power Tweaks Web Accessories and Buttons
  207.    echo       [2] Buttons only (leave Power Tweaks)
  208.    echo       [3] Nothing - return to main menu
  209.  
  210.    choice /c:1234 /n /t:4,90
  211.  
  212.    if errorlevel 4 goto UNINST
  213.    if errorlevel 3 goto MENU
  214.    if errorlevel 2 goto UN-BUTT
  215.    if errorlevel 1 goto UN-COMP
  216.  
  217. goto UNINST
  218.  
  219. ::------
  220. :UN-COMP
  221. ::------
  222.  
  223.    :: check for install of PowerTweaks WebAccessories
  224.  
  225.    start /w regedit /e ie5wa.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IE5WA
  226.    if exist ie5wa.reg goto IE5WA
  227.  
  228.    :: check for previous install of WebZone
  229.  
  230.    if exist %WINDIR%\SYSTEM\webzone.dll goto REM-ALL
  231.    if exist %WINDIR%\SYSTEM32\webzone.dll goto REM-ALL
  232.  
  233.    goto NO-PT
  234.  
  235.    :REM-ALL
  236.  
  237.    :: uninstall WebZone and buttons
  238.  
  239.    start /w RunDll32 advpack.dll,LaunchINFSection %WINDIR%\inf\webzone.inf, Uninstall
  240.  
  241.    :: confirm uninstallation
  242.  
  243.    if exist %WINDIR%\SYSTEM\webzone.dll goto ERROR
  244.    if exist %WINDIR%\SYSTEM32\webzone.dll goto ERROR
  245.  
  246.    goto SUCC-3
  247.  
  248. ::------
  249. :UN-BUTT
  250. ::------
  251.  
  252.    :: check for previous install of WebZone
  253.  
  254.    if exist %WINDIR%\SYSTEM\TSGRAY.ICO goto REM-BUTT
  255.    if exist %WINDIR%\SYSTEM32\TSGRAY.ICO goto REM-BUTT
  256.  
  257.    goto NO-BUTT
  258.  
  259.    :REM-BUTT
  260.  
  261.    if exist %WINDIR%\SYSTEM32\config goto RMV-NT
  262.  
  263.    :: uninstall Buttons on 9x-Me
  264.  
  265.    start /w regedit.exe /s webzone\zb-rem.reg
  266.  
  267.    del %WINDIR%\SYSTEM\TSGRAY.ICO
  268.    del %WINDIR%\SYSTEM\RSGRAY.ICO
  269.    del %WINDIR%\SYSTEM\TSCOLOR.ICO
  270.    del %WINDIR%\SYSTEM\RSCOLOR.ICO
  271.  
  272.    goto SUCC-4
  273.  
  274.    :RMV-NT
  275.  
  276.    :: uninstall Buttons on NT-2K-XP
  277.  
  278.    start /w regedit.exe /s webzone\zb-rem.reg
  279.  
  280.    del %WINDIR%\SYSTEM32\TSGRAY.ICO
  281.    del %WINDIR%\SYSTEM32\RSGRAY.ICO
  282.    del %WINDIR%\SYSTEM32\TSCOLOR.ICO
  283.    del %WINDIR%\SYSTEM32\RSCOLOR.ICO
  284.  
  285.    goto SUCC-4
  286.  
  287. ::********************************************************************
  288. :NO-PT
  289. ::********************************************************************
  290.  
  291.      cls
  292.  
  293.      echo.
  294.      echo.
  295.      echo    Sorry, but Power Tweaks Web Accessories doesn't appear
  296.      echo    to be installed on this computer. 
  297.      echo.
  298.      echo.
  299.      pause
  300.      goto RETURN
  301.  
  302. ::********************************************************************
  303. :NO-BUTT
  304. ::********************************************************************
  305.  
  306.      cls
  307.  
  308.      echo.
  309.      echo.
  310.      echo    Sorry, but the zone buttons don't appear
  311.      echo    to be installed on this computer. 
  312.      echo.
  313.      echo.
  314.      pause
  315.      goto RETURN
  316.  
  317. ::********************************************************************
  318. :NO-WA
  319. ::********************************************************************
  320.  
  321.      cls
  322.  
  323.      echo.
  324.      echo.
  325.      echo    Sorry, but Power Tweaks Web Accessories doesn't appear
  326.      echo    to be installed on this computer. Please install it
  327.      echo    before trying to install the buttons.
  328.      echo.
  329.      echo    Hint: you can choose Option 1 from the Install Menu
  330.      echo    and install both at the same time.
  331.      echo.
  332.      echo.
  333.      pause
  334.      goto RETURN
  335.  
  336.  
  337. ::********************************************************************
  338. :IE5WA
  339. ::********************************************************************
  340.  
  341.      cls
  342.   
  343.      echo.
  344.      echo.
  345.      echo    WebZone was NOT uninstalled because IE5 Power Tweaks
  346.      echo    Web Accessories is installed on this computer. If you
  347.      echo    wish to uninstall WebZone, uninstall the IE5 Power Tweaks
  348.      echo    Web Accessories through Add-Remove Programs in the
  349.      echo    Control Panel. Then return to this utility to completely
  350.      echo    remove the buttons.
  351.      echo.
  352.      pause
  353.      
  354.      del ie5wa.reg>nul
  355.  
  356.      goto MENU
  357.  
  358. ::********************************************************************
  359. :ERROR
  360. ::********************************************************************
  361.  
  362.      cls
  363.  
  364.      echo.
  365.      echo.
  366.      echo    An error ocurred while performing this task...
  367.      echo.
  368.      echo.
  369.      pause
  370.      goto RETURN
  371.  
  372. ::********************************************************************
  373. :SUCCESS
  374. ::********************************************************************
  375.  
  376.      cls
  377.   
  378.      echo.
  379.      echo.
  380.      echo    SUCCESS!!
  381.      echo.
  382.      echo    The PowerTweaks WebAccesory and Toolbar buttons
  383.      echo    have been installed on this computer.
  384.      echo.
  385.      goto RETURN
  386.  
  387. ::********************************************************************
  388. :SUCC-2
  389. ::********************************************************************
  390.  
  391.      cls
  392.   
  393.      echo.
  394.      echo.
  395.      echo    SUCCESS!!
  396.      echo.
  397.      echo    The IE Toolbar buttons have been installed on this computer.
  398.      echo.
  399.      goto RETURN
  400.  
  401. ::********************************************************************
  402. :SUCC-3
  403. ::********************************************************************
  404.  
  405.      cls
  406.   
  407.      echo.
  408.      echo.
  409.      echo    SUCCESS!!
  410.      echo.
  411.      echo    The PowerTweaks WebAccesory and Toolbar buttons
  412.      echo    have been removed from this computer.
  413.      echo.
  414.      goto RETURN
  415.  
  416. ::********************************************************************
  417. :SUCC-4
  418. ::********************************************************************
  419.  
  420.      cls
  421.   
  422.      echo.
  423.      echo.
  424.      echo    SUCCESS!!
  425.      echo.
  426.      echo    The IE Toolbar buttons have been removed from this computer.   
  427.      echo.
  428.      goto RETURN
  429.  
  430. ::********************************************************************
  431. :RETURN
  432. ::********************************************************************
  433.  
  434. :: -----------------
  435. :: Give Choice Again
  436. :: -----------------
  437.  
  438.      echo.
  439.      echo    What do you want to do now?
  440.      echo.
  441.      echo    [1] Return to Main Menu
  442.      echo    [2] Exit
  443.      echo.
  444.  
  445.      choice /c:123 /n /t:3,90
  446.  
  447.      if errorlevel 3 goto menu
  448.      if errorlevel 2 goto fin
  449.      if errorlevel 1 goto menu
  450.  
  451. ::********************************************************************
  452. :FIN
  453. ::********************************************************************
  454.  
  455.   :: Delete previous check.reg
  456.   if exist check.reg del check.reg>nul
  457.  
  458.    cls
  459.  
  460.    echo.
  461.    echo.
  462.    echo    Bye for now...
  463.    echo.
  464.    echo.
  465.